home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 19 / Amiga Plus Leser CD 19.iso / Online / AmigaTalk / intuition / BOOPSIMethodIDs.st < prev    next >
Text File  |  2002-03-15  |  2KB  |  53 lines

  1. " -------------------------------------------------------------------- "
  2. " MethodIDs Class is a Singleton class that allows the user to         "
  3. " reference BOOPSI Method IDs without having to remember their actual  "
  4. " hexadecimal values.                                                  "
  5. ""
  6. " The User does NOT need to create one of these, since Intuition Class "
  7. " will instantiate the only needed instance of this Class.  See the    "
  8. " SetupIntuition.st source file for the method(s) that help the User   "
  9. " with this Class.                                                     "
  10. ""
  11. "  EXAMPLE:  'myTag <- intuition getMethodID: #OM_DISPOSE'             "
  12. ""
  13. " ALL singleton classes MUST contain the following:                    "
  14. ""
  15. "   the methods:  isSingleton AND privateSetup     AND                 "
  16. "                 uniqueInstance Class instance variable.              "
  17. " -------------------------------------------------------------------- "
  18.  
  19. Class MethodIDs :Dictionary ! uniqueInstance !
  20. [
  21.    isSingleton
  22.      ^ true  
  23. |  
  24.    privateNew ! newinstance !
  25.      newinstance <- super new.
  26.  
  27.      ^ newinstance
  28. |
  29.    new
  30.      ^ self privateSetup
  31. |
  32.    privateSetup
  33.      (uniqueInstance isNil)
  34.        ifTrue: [uniqueInstance <- self privateNew.
  35.  
  36.                 self at: #OM_Dummy     put: 16r100.
  37.  
  38.                 self at: #OM_NEW       put: 16r101.
  39.                 self at: #OM_DISPOSE   put: 16r102.
  40.                 self at: #OM_SET       put: 16r103.
  41.                 self at: #OM_GET       put: 16r104.
  42.                 self at: #OM_ADDTAIL   put: 16r105.
  43.                 self at: #OM_REMOVE    put: 16r106.
  44.                 self at: #OM_NOTIFY    put: 16r107.
  45.  
  46.                 self at: #OM_UPDATE    put: 16r108.
  47.                 self at: #OM_ADDMEMBER put: 16r109.
  48.                 self at: #OM_REMMEMBER put: 16r10A.
  49.                ].
  50.                
  51.      ^ self    "or ^ uniqueInstance??"
  52. ]
  53.